'use strict';

/**
 * Created by twer on 15/3/22.
 */
angular.module('home').controller('HomeCtrl', [
    '$scope',
    '$rootScope',
    '$routeParams',
    'BlogListService',
    'ShareResourcesService',
    'CourseService',
    function ($scope, $rootScope, $routeParams, BlogListService, ShareResourcesService, CourseService) {
        $rootScope.visitedUserId = $routeParams.userId;

        $scope.blogs = BlogListService.query({offset: 0, countPerPage: 6, author: $routeParams.userId});
        $scope.mainShare = ShareResourcesService.query({userId: $routeParams.userId});
        $scope.mainCourse = CourseService.query({userId: $routeParams.userId});
    }]);
